fix(config): harden resolved path serialization - #692
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens the coven config paths --json (schema coven.config.paths v1) output so that “resolved” paths are always absolute and losslessly representable as UTF-8, failing closed for single- and multi-path surfaces when that contract can’t be met.
Changes:
- Replace lossy
Path::display().to_string()serialization with a losslessto_str()gate, reporting affected surfaces asunresolvedwhen UTF-8 cannot be represented exactly. - Make multi-path surfaces fail closed atomically (no partial
pathsoutput) and preserve the originatingsourcewhen failing. - Update CLI documentation and add integration coverage for non-Unicode environment-provided paths.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| docs/reference/cli-config.md | Documents the UTF-8 losslessness rule, atomic failure for multi-path surfaces, and platform-aware relative resolution semantics. |
| crates/coven-cli/tests/config_paths.rs | Adds an integration test ensuring non-Unicode env paths cause unresolved output without partial/lossy paths. |
| crates/coven-cli/src/config_paths.rs | Implements lossless resolved path serialization, atomic multi-path handling, source-preserving unresolved rows, and Windows drive-relative resolution via platform semantics. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #688.
Harden
coven config paths --jsonso its version 1 contract never labels lossy or relative path strings as resolved.HOMEDRIVE+HOMEPATHsource comparisonVerification
cargo fmt --all -- --checkcargo clippy --workspace --all-targets -- -D warningscargo test --workspace --lockedcargo test -p coven-cli config_paths::tests --lockedcargo test -p coven-cli --test config_paths --lockedpython3 scripts/check-secrets.pypython3 scripts/check-coven-privacy.py --range origin/main...HEADAll passed at
14fcf57. The full workspace suite was rerun from a short exact-head worktree because two unrelated memory-import socket tests exceed UnixSUN_LENunder the longer familiar workspace path.